//
//  XLCryptoTool.m
//  XLCryptoTool
//
//  Created by ilongge on 2022/8/16.
//

#import "XLCryptoTool.h"
#import "XLSHAUtils.h"

@implementation XLCryptoTool

#pragma mark AES

+ (NSData *)aesEncryptWithKey:(NSString *)cryptKey andIvKey:(NSString *)ivKey andMode:(XL_AES_Crypto_Mode)mode andData:(NSData *)cryptData
{
    NSData *data = [XLAESUtils encryptWithKey:cryptKey andIvKey:ivKey andMode:mode andData:cryptData];
    return data;
}
+ (NSString *)aesEncryptWithKey:(NSString *)cryptKey andIvKey:(NSString *)ivKey andMode:(XL_AES_Crypto_Mode)mode andText:(NSString *)cryptText
{
    NSString *text = [XLAESUtils encryptWithKey:cryptKey andIvKey:ivKey andMode:mode andText:cryptText];
    return text;
}
+ (NSData *)aesDecryptWithKey:(NSString *)cryptKey andIvKey:(NSString *)ivKey andMode:(XL_AES_Crypto_Mode)mode andData:(NSData *)cryptData
{
    NSData *data = [XLAESUtils decryptWithKey:cryptKey andIvKey:ivKey andMode:mode andData:cryptData];
    return data;
}
+ (NSString *)aesDecryptWithKey:(NSString *)cryptKey andIvKey:(NSString *)ivKey andMode:(XL_AES_Crypto_Mode)mode andText:(NSString *)cryptText
{
    NSString *text = [XLAESUtils decryptWithKey:cryptKey andIvKey:ivKey andMode:mode andText:cryptText];
    return text;
}


#pragma mark SHA

+ (NSString *)shaCryptoWithMode:(XL_SHA_Crypto_Mode)cryptoMode
                     andKeyMode:(XL_SHA_Key_Mode)keyMode
                         andKey:(NSString *)encryptKey
                        andText:(NSString *)text
{
    NSString *cryptoString = [XLSHAUtils shaCryptoWithMode:cryptoMode
                                                andKeyMode:keyMode
                                                    andKey:encryptKey
                                                   andText:text];
    return cryptoString;
}
@end
